﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using StateGrid.MDBservice;

namespace StateGrid.NYBG
{
    /// <summary>
    /// Summary description for NYBG_PM
    /// </summary>
    public class NYBG_PM : PM
    {
        /// <summary>
        /// 分类编码
        /// </summary>
        public String flbm
        {
            get;
            set;
        }

        /// <summary>
        /// 索引编码
        /// </summary>
        public String sybm
        {
            get;
            set;
        }

        /// <summary>
        /// 文件名
        /// </summary>
        public String wjm
        {
            get;
            set;
        }

        /// <summary>
        /// 原文件名
        /// </summary>
        public String ywjm
        {
            get;
            set;
        }

        /// <summary>
        /// 页数
        /// </summary>
//        public int ys
//        {
//            get;
//            set;
//        }

        /// <summary>
        /// 报告名称
        /// </summary>
        public String bgmc
        {
            get;
            set;
        }

        /// <summary>
        /// 年份
        /// </summary>
        public int nf
        {
            get;
            set;
        }

        /// <summary>
        /// 出版日期
        /// </summary>
        public DateTime cbrq
        {
            get;
            set;
        }

        /// <summary>
        /// 作者
        /// </summary>
        public String zz
        {
            get;
            set;
        }

        /// <summary>
        /// 作者单位
        /// </summary>
        public String zzdw
        {
            get;
            set;
        }

        /// <summary>
        /// 主办单位
        /// </summary>
        public String zbdw
        {
            get;
            set;
        }
        /// <summary>
        /// 主题词
        /// </summary>
        public String ztc
        {
            get;
            set;
        }
        /// <summary>
        /// 文摘
        /// </summary>
        public String wz
        {
            get;
            set;
        }

        /// <summary>
        /// 报告号
        /// </summary>
        public String bgh
        {
            get;
            set;
        }

        /// <summary>
        /// 分类体系
        /// </summary>
        public String fltx
        {
            get;
            set;
        }
        /// <summary>
        /// 子分类
        /// </summary>
        public String zfl
        {
            get;
            set;
        }

        /// <summary>
        /// 文献编号
        /// </summary>
        public String wxbh
        {
            get;
            set;
        }

        /// <summary>
        /// 全文是否存在
        /// </summary>
        public Boolean qw
        {
            get;
            set;
        }

        /// <summary>
        /// 更新日期
        /// </summary>
        public DateTime gxrq
        {
            get;
            set;
        }
        /// <summary>
        /// 登录人
        /// </summary>
        public String dlr
        {
            get;
            set;
        }
        public NYBG_PM()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public override string ToString()
        {
            String ret;
            ret = "[索引编码]" + this.sybm + "[报告号]" + this.bgh + " [报告名称]" + this.bgmc;
            return ret;
        }

        public override string AllContent()
        {
            String ret = "('" + flbm + "','" + sybm + "','" + wjm + "','" + ys + "','" + bgmc + "','" + nf + "','" + cbrq + "','" + zz + "','" + zzdw + "','" + zbdw + "','" + ztc + "','" + wz + "','" + bgh + "','" + fltx + "','" + zfl + "','" + wxbh + "','" + ywjm + "','" + qw + "','" + gxrq + "')";
            return ret;
        }

        public override void fillEmptyStringAsNull()
        {
            String temp = "NULL";
            if (String.Empty.Equals(this.flbm)) flbm = temp;
            if (String.Empty.Equals(this.sybm)) sybm = temp;
            if (String.Empty.Equals(this.wjm)) wjm = temp;
            //跳过整型 “页数”
            if (String.Empty.Equals(this.bgmc)) bgmc = temp;
            //if (String.Empty.Equals(this.nf)) nf = temp;
            //跳过DataTime型 "出版日期"
            if (String.Empty.Equals(this.zz)) zz = temp;
            if (String.Empty.Equals(this.zzdw)) zzdw = temp;
            if (String.Empty.Equals(this.zbdw)) zbdw = temp;
            if (String.Empty.Equals(this.ztc)) ztc = temp;
            if (String.Empty.Equals(this.wz)) wz = temp;
            if (String.Empty.Equals(this.bgh)) bgh = temp;
            if (String.Empty.Equals(this.fltx)) fltx = temp;
            if (String.Empty.Equals(this.zfl)) zfl = temp;
            if (String.Empty.Equals(this.wxbh)) wxbh = temp;
            if (String.Empty.Equals(this.ywjm)) ywjm = temp;
            //跳过bool型变量 "全文"
            //跳过DataTime型 "更新日期"
        }

        public override void eraseNullInEmptyString()
        {
            String temp = "NULL";
            if (temp.Equals(this.flbm)) flbm = String.Empty;
            if (temp.Equals(this.sybm)) sybm = String.Empty;
            if (temp.Equals(this.wjm)) wjm = String.Empty;
            //跳过整型 “页数”
            if (temp.Equals(this.bgmc)) bgmc = String.Empty;
            //跳过整型变量 "年份"
            //跳过DataTime型 "出版日期"
            if (temp.Equals(this.zz)) zz = String.Empty;
            if (temp.Equals(this.zzdw)) zzdw = String.Empty;
            if (temp.Equals(this.zbdw)) zbdw = String.Empty;
            if (temp.Equals(this.ztc)) ztc = String.Empty;
            if (temp.Equals(this.wz)) wz = String.Empty;
            if (temp.Equals(this.bgh)) bgh = String.Empty;
            if (temp.Equals(this.fltx)) fltx = String.Empty;
            if (temp.Equals(this.zfl)) zfl = String.Empty;
            if (temp.Equals(this.wxbh)) wxbh = String.Empty;
            if (temp.Equals(this.ywjm)) ywjm = String.Empty;
            //跳过bool型变量 "全文"
            //跳过DataTime型 "更新日期"
        }
    }
}